package com.qiyeji.real_estate.ProjectTask;

import com.qiyeji.real_estate.entity.projectPhase;
import com.qiyeji.real_estate.service.ProjectPhaseService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class UpdateRenderState implements JavaDelegate {

    @Autowired
    ProjectPhaseService projectPhaseService;

    @Override
    public void execute(DelegateExecution execution) throws Exception {

        System.out.println("修改渲染阶段状态为完成！");
        projectPhaseService.updateByPrimaryKey(new projectPhase(execution.getBusinessKey(), "渲染", "完成"));
        System.out.println("修改项目后期阶段状态为正在进行！");
        projectPhaseService.updateByPrimaryKey(new projectPhase(execution.getBusinessKey(), "后期", "正在进行"));
    }
}
